/*
 * byggern.c
 *
 * Created: 10.09.2012 14:52:57
 *  Author: bardbakk
 */ 

#define F_CPU 4915200
#include <stdio.h>
#include "SRAM.h"
#include "USART.h"
#include "JOY.h"
#include <avr/io.h>
#include <avr/delay.h>

int main(void)
{
	USART_init(31);
	SRAM_init();
	
	volatile char* oled = (char *)0x1000;
    char adc;
	volatile char* sram = (char *)0x1800;

	JOY_calibration();
	JOY_Pos pos;
	
    while(1)
    {
		pos = JOY_read();
		//_delay_ms(200);
		printf(" X: %d  Y: %d",pos.x,pos.y);
    }
}